package nl.ruudshuis.data;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import nl.ruudshuis.db.DBmanager;

public class ContextListener implements ServletContextListener {

	public void contextInitialized(ServletContextEvent event) {
		ServletContext context = event.getServletContext();
		String db = context.getInitParameter("dblocation");
		DBmanager myDb = DBmanager.getInstance(db);
		context.setAttribute("dbman", myDb);
	}

	public void contextDestroyed(ServletContextEvent event) {

	}
}